#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTableWidgetItem>
#include <QModbusDataUnit>
#include <QModbusClient>
#include <QModbusRtuSerialMaster>
#include <QSerialPort>
#include <QModbusClient>
#include <QMessageBox>
#include <QDebug>
#include <QModbusReply>
#include <QModbusTcpClient>
#include <QModbusServer>
#include <QModbusTcpServer>
#include <QModbusRtuSerialSlave>
#include <QInputDialog>
#include "dialog06btn.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:


    void on_comboBox_pType_currentTextChanged(const QString &arg1);

    void on_comboBox_sType_currentTextChanged(const QString &arg1);

    void on_pushButton_pCon_clicked();

    void on_pushButton_p03_clicked();

    void on_pushButton_p06_clicked();

    void on_pushButton_p16_clicked();

    void on_pushButton_sCon_clicked();

    void on_tableWidget_sTableWidget_cellChanged(int row, int column);

    void on_comboBox_sTableType_currentIndexChanged(int index);

private:
    Ui::Widget *ui;

    //定义主站父类对象
    QModbusClient *master = nullptr;
    QModbusServer *slave = nullptr;

    Dialog06Btn *dialog06Btn = nullptr;

    //初始化主站
    void initPollFunc();
    //初始化从站
    void initSlaveFunc();


};
#endif // WIDGET_H
